from git import Repo as repository

# 本地开发库路径
localRepoPath = 'E:/code/self/java/test/python'
remoteRepoPath = 'https://github.com/CodeWorkerCoding/-training-ground.git'

# 构建一个已经clone的repository
localRepo = repository(localRepoPath)
assert not localRepo.bare

localRepo.config_reader()

with localRepo.config_writer():
    pass

print(localRepo.is_dirty())

files = localRepo.untracked_files
print(files)


branch = localRepo.active_branch
print(branch)

# assert not localRepo.is_dirty()

# files = localRepo.untracked_files



# 构建一个全新的repository
# repo = repository.clone_from(remoteRepoPath, localRepoPath)
heads = localRepo.heads
print(heads)
master = heads.master
print(master)


